package com.uwlaser.service.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * 登陆接口结果
 */
@Data
public class DeviceLoginResult {


    @ApiModelProperty("角色")
    private List<String> roles;


    @ApiModelProperty("用户信息")
    private User user;

    public void setUser(String userName, String nickName, String avatarName) {
        this.user = new User(userName,nickName,avatarName);
    }

    @Data
    public class User {

        @ApiModelProperty("账号")
        private String userName;

        @ApiModelProperty("姓名")
        private String nickName;

        @ApiModelProperty("头像地址")
        private String avatarName;

        public User(String userName, String nickName, String avatarName) {
            this.userName = userName;
            this.nickName = nickName;
            this.avatarName = avatarName;
        }
    }
}
